/**
 * MenuFrameMainMenu.java
 *
 * Roslan's Remake of MOO in 3D using Ardor3D
 * (C) 2011 Roslan Amir. All rights reserved.
 */

package com.roslan.games.moo3d.ui.menu;

import com.ardor3d.extension.ui.UIButton;
import com.ardor3d.extension.ui.event.ActionEvent;
import com.ardor3d.extension.ui.event.ActionListener;
import com.roslan.games.moo3d.GameData.Actions;

/**
 * Comments go here.
 * 
 * @author Roslan Amir
 * @version 1.0 - Jan 27, 2011
 */
public class MenuFrameMainMenu extends MenuFrameBase {

	/**
	 * Default no-arg constructor.
	 * 
	 * @param camera
	 */
	public MenuFrameMainMenu() {
		super("Main Menu");

		/*
		 * Continue Game button
		 */
		final UIButton button1 = new UIButton("", SUBTEX_MAIN_MENU_BUTTONS[0]);
		button1.setGap(0);
		button1.setMargin(MARGINS);
		button1.setPadding(PADDING);
		button1.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				gameData.action = Actions.CONTINUE_GAME;
			}
		});
		vpanel.add(button1);

		/*
		 * Load Game button
		 */
		final UIButton button2 = new UIButton("", SUBTEX_MAIN_MENU_BUTTONS[1]);
		button2.setGap(0);
		button2.setMargin(MARGINS);
		button2.setPadding(PADDING);
		button2.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				gameData.action = Actions.SHOW_LOAD_GAME_MENU;
			}
		});
		vpanel.add(button2);

		/*
		 * New Game button
		 */
		final UIButton button3 = new UIButton("", SUBTEX_MAIN_MENU_BUTTONS[2]);
		button3.setGap(0);
		button3.setMargin(MARGINS);
		button3.setPadding(PADDING);
		button3.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				gameData.action = Actions.SHOW_NEW_GAME_MENU;
			}
		});
		vpanel.add(button3);

		/*
		 * Options button
		 */
		final UIButton button4 = new UIButton("", SUBTEX_MAIN_MENU_BUTTONS[3]);
		button4.setGap(0);
		button4.setMargin(MARGINS);
		button4.setPadding(PADDING);
		button4.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				gameData.action = Actions.SHOW_OPTIONS_MENU;
			}
		});
		vpanel.add(button4);

		/*
		 * Exit button
		 */
		final UIButton button5 = new UIButton("", SUBTEX_MAIN_MENU_BUTTONS[4]);
		button5.setGap(0);
		button5.setMargin(MARGINS);
		button5.setPadding(PADDING);
		button5.addActionListener(new ActionListener() {
			public void actionPerformed(final ActionEvent event) {
				gameData.action = Actions.EXIT_GAME;
			}
		});
		vpanel.add(button5);

		/*
		 * Finalization
		 */
		this.setName("Main Menu");
		this.setContentPanel(vpanel);
		super.setUpFrame();
	}

}
